﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Microsoft.Practices.Unity;
using ePlanet.SingleWell.Models;
using ePlanet.SingleWell.Services;
using Web.SystemConfig.SysCache;
using Web.SystemConfig.WorkFlow;
using DreamBuilder.Core.Container;
using ePlanet.SingleWell.Business;
using Web.SystemConfig.Models;
using Web.SystemConfig.Services;
using Web.SystemConfig.Business;
using Web.SystemLogin.Models;
using System.Data;

namespace Web.Views.SingleWellManage
{
    public partial class ASingleWellSearch : PageBase
    {
        [Dependency]
        public ISingleWellService m_ISingleWellService
        {
            get;
            set;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.xSinglewell.AfterFiltered += new EventHandler(xSinglewell_AfterFiltered);
            if (IsPostBack)
            {
                ///
            }
        }

        protected void btnSearchSingelWell_Click(object sender, EventArgs e)
        {
            try
            {
                string sql = "select * from singlewell";
                DataTable oDataTable = this.m_ISingleWellService.ExecSql(sql);
                if (oDataTable != null && oDataTable.Rows.Count > 0)
                {
                    this.gv_SingleWellList.DataSource = oDataTable;
                    this.gv_SingleWellList.DataBind();
                    //this.xSinglewell.ArchiveSourceTable = oDataTable;
                    
                }
            }
            catch(Exception ex)
            {
                Alert("查询发生异常："+ex.Message);
            }
        }

        void xSinglewell_AfterFiltered(object sender, EventArgs e)
        {
            //this.gv_SingleWellList.DataSource = this.xSinglewell.ArchiveFilteredTable;
            //this.gv_SingleWellList.DataBind();
        }

        
    }
}